package main

import (
	"fmt"
)

type IPAddr [4]byte

// TODO: Add a "String() string" method to IPAddr.
func (v IPAddr) String() string {
	var str_ip string
	ip_len := len(v)
	for i := 0; i < ip_len; i++ {
		str_ip += fmt.Sprintf("%v.", v[i])
	}
	str_ip = str_ip[:len(str_ip)-1]
	return str_ip

}

func main() {
	addrs := map[string]IPAddr{
		"loopback":  {127, 0, 0, 1},
		"googleDNS": {8, 8, 8, 8},
	}
	for n, a := range addrs {
		fmt.Println("%v: %v\n", n, a)

	}

}
